class Layer {

}

class Router{
    constructor(method,pathname,callback){
        this.stack = [];
    }
    match(requestPath,){

    }
    get(){
        //调用get 就是来维护用映射关系的
        new Layer('get',pathname,callback);
        this.stack.push(layer);
    }
    routes(){//中间件
        return async (ctx,name)=>{
            //请求到来时调用此方法
            let requestPath = ctx.path;
            let requestMethod = ctx.method;
            this.stack.fill(layer =>layer.match())
        }
    }
}